package com.heartware.sh.blackhole.ui.fragment;

import android.os.Bundle;
import android.os.SystemClock;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.heartware.sh.blackhole.ui.fragment.base.BaseNullFragment;
import com.heartware.sh.blackhole.ui.fragment.view.LoadingPager;

/**
 * Created by Administrator on 2018/3/22 0022.
 */

public class Null2Fragment extends BaseNullFragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View rootView = super.onCreateView(inflater, container, savedInstanceState);

        return rootView;
    }

    @Override
    public void load() {


        new Thread(new Runnable() {
            @Override
            public void run() {

                SystemClock.sleep(2000);

                handler.post(new Runnable() {
                    @Override
                    public void run() {

//                        if(loadingPager != null){
//                            loadingPager.setState(LoadingPager.LoadingResult.ERROR);
//                            loadingPager.showPage();
//                        }

                    }
                });

            }
        }).start();

    }

    @Override
    public void init() {

    }

    @Override
    public View createSuccessView() {

        TextView tv = new TextView(getContext());
        tv.setText("加载成功");
        tv.setTextSize(40);
        return tv;
    }
}
